package com.geek688.auxiliarytool.main;

import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Image;
import java.awt.Point;
import java.awt.Toolkit;
import java.net.URL;

import javax.swing.JFrame;
import javax.swing.JTabbedPane;
import javax.swing.WindowConstants;

import com.geek688.auxiliarytool.ui.FileReplaceUI;
import com.geek688.auxiliarytool.ui.SQLUI;

/**
 * 入口
 * @author hanjiefei
 *
 */
public class AuxiliaryTool extends JFrame {

	private static final long serialVersionUID = 1L;
	private double WIDTH = Toolkit.getDefaultToolkit().getScreenSize().getWidth();
	private double HEIGHT = Toolkit.getDefaultToolkit().getScreenSize().getHeight();
	
	public static void main(String[] args) {
		new AuxiliaryTool();
	}
	
	public AuxiliaryTool() {
		JTabbedPane tabPanel = new JTabbedPane();
		tabPanel.setPreferredSize(new Dimension(784,572));
    	this.setLocation(new Point((int) (WIDTH / 2) -400, (int) (HEIGHT / 2)-310));
        this.setSize(800, 610);  
        this.setTitle("代码辅助工具"); 
        this.setResizable(false);
        this.setLayout(new FlowLayout(FlowLayout.CENTER));
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        Container container = this.getContentPane();
        FileReplaceUI replaceUI = new FileReplaceUI();
        replaceUI.drawUI(tabPanel);
        SQLUI sqlui = new SQLUI();
        sqlui.drawUI(tabPanel);
//        ApiScannerUI apiScannerUI = new ApiScannerUI();
//        apiScannerUI.drawUI(tabPanel);
        container.add(tabPanel);
        URL url = this.getClass().getResource("/logo.png");
        Image img = Toolkit.getDefaultToolkit().getImage(url);
        this.setIconImage(img);
        this.setVisible(true);
	}
}
